/* import { init } from 'snabbdom/init'
import { classModule } from 'snabbdom/modules/class'
import { propsModule } from 'snabbdom/modules/props'
import { styleModule } from 'snabbdom/modules/style'
import { eventListenersModule } from 'snabbdom/modules/eventlisteners'
import { h } from 'snabbdom/h' // helper function for creating vnodes

const patch = init([classModule, propsModule, styleModule, eventListenersModule])

const container = document.getElementById('container')
const btn = document.getElementById('btn')
// h函数是可以嵌套的,如果只有一个子元素，可以不适用数组，只是用一个h函数即可
const myVnode1 = h('ul', [
    h('li', 'apple'),
    h('li', 'banana'),
    h('li', 'peach')
])
const myVnode2 = h('ul', [
    h('li', 'apple'),
    h('li', 'banana'),
    h('li', 'peach'),
    h('li', 'peach')
])
// 让虚拟节点上树
patch(container, myVnode1)
// 添加事件
btn.onclick = () => {
    patch(myVnode1, myVnode2)
} */
import h from './mysnabbdom/h.js'
import patch from './mysnabbdom/patch.js'
const myVnode2 = h('ul', {}, [
    h('li', {}, 'apple'),
    h('li', {}, 'banana'),
    h('li', {}, 'peach'),
    h('li', {}, 'peach')
])
const container = document.getElementById('container')
patch(container, myVnode2)